package com.bookdemo.controller;

import com.alibaba.fastjson.JSON;

import com.bookdemo.pojo.User;
import com.bookdemo.service.UserService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

/**
 * @author zhu
 *
 */
@RestController
public class UserController {
    @Autowired
    UserService userService;

    @RequestMapping("/alluser")
    public String getUserList(User user,Integer pageNum,Integer pageSize){
        List<User> allUser = userService.findAllUser();
        String users_json = JSON.toJSONString(allUser);
        return users_json;
    }

}
